package com.sylar.lelepub;

import java.util.ArrayList;
import java.util.List;

import com.sylar.lelepub.adapter.OrderAdapter;
import com.sylar.lelepub.widget.XListView;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.AdapterView;
import android.widget.AdapterView.OnItemClickListener;
import android.widget.TextView;

public class TabOrderActivity extends Activity implements OnItemClickListener{
	private XListView order_listView;

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);

		setContentView(R.layout.layout_myorder_list);

		View btn_title_left = findViewById(R.id.btn_title_left);
		btn_title_left.setVisibility(View.GONE);
		View btn_title_right = findViewById(R.id.btn_title_right);
		btn_title_right.setVisibility(View.GONE);

		TextView tv_title_name = (TextView) findViewById(R.id.tv_title_name);
		tv_title_name.setText("我的订单");

		order_listView = (XListView) findViewById(R.id.order_listView);
		order_listView.setOnItemClickListener(this);
		
		List<String> items = new ArrayList<String>();
		for(int i=0;i<=20;i++){
			items.add(""+i);
		}
		
		OrderAdapter orderAdapter = new OrderAdapter(getApplicationContext());
		orderAdapter.setListPageItems(items);
		
		order_listView.setAdapter(orderAdapter);
		
	}

	@Override
	public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
		Intent intent = new Intent(this,DetailOrderActivity.class);
		intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
		startActivity(intent);
	}
}
